{__NOLAYOUT__}
<!DOCTYPE html>
<html lang="en">
{include file="_index"}
<body>
<div style="width: 1200px;">
            <div class="row">
                <div class="col-xs-12">
                    <table id="simple-table" class="table  table-bordered table-hover">
                        <thead>
                        <tr>
                            <th class="center">
                                <label class="pos-rel">
                                    <input type="checkbox" class="ace">
                                    <span class="lbl"></span>
                                </label>
                            </th>
                            <th class="detail-col center">ID</th>
                            <th class="center">名称</th>
                            <th class="center">职务</th>
                            <th class="center">电话</th>
                        </tr>
                        </thead>

                        <tbody>
                        {foreach $list as $val}
                        <tr  class="center">
                            <td>
                                <label class="pos-rel">
                                    <input type="checkbox" {if $depart==$val->department_id && $depart != 0} checked{/if} class="ace checkValue">
                                    <span class="lbl"></span>
                                </label>
                            </td>
                            <td class="idValue">{$val->id}</td>
                            <td class="nameValue">{$val->User->nickname}</td>
                            <td>{$val->joinLevle->name}</td>

                            <td>{$val->phone}</td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                    {$page_html['html']}
                </div><!-- /.span -->

                {if !empty($list)}
                <div class="col-md-offset-3 col-md-9">
                    <button class="btn btn-info selectBtn" type="button">
                        <i class="ace-icon fa fa-check bigger-110"></i>
                        选择
                    </button>
                </div>
                {/if}
            </div><!-- /.row -->
    </div>
<script>
    $(".selectBtn").click(function () {
        var list = $(".checkValue:checked");
        var id_arr = new Array();
        var name_arr = new Array();
        list.each(function () {
            var par = $(this).parents('tr');
            var id = par.find('.idValue').text();
            var name = par.find('.nameValue').text();

            id_arr.push(id);
            name_arr.push(name);
        });

        var data = new Array(id_arr,name_arr);
        parent.ShowBox(data);
    });
</script>
</body>
</html>